<%@ page import="MypageController.MyComment.MyCommentBean" %>
<%@ page import="MypageController.MyKategore.MyKategoreBean" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


<link rel="stylesheet" type="text/css" href="/KOMORIUTA/Mypage/Css/MpKategorie.css">
<script src="/KOMORIUTA/Mypage/Mp_Script.js" type="text/JavaScript"></script>
<script src="/KOMORIUTA/Massage/Ms_Script.js" type="text/JavaScript"></script>
<script src="/KOMORIUTA/Main/OldMain/Old_JScript.js" type="text/JavaScript"></script>
<script src="/KOMORIUTA/Main/FirstMain/jquery.js" type="text/javascript"></script> 
<style type="text/css">  
a img{ border:none;} 
</style>
<style type="text/css">
a:link, a:visited, a:active{color: black; text-decoration:none;}
a:hover{text-decoration:underline;}
</style>

<% 
String Mem_Nick = (String)session.getAttribute("Mem_Nick");

MyKategoreBean[] kategorilist = null;
if((MyKategoreBean[])request.getAttribute("kategorilist") != null){
	kategorilist = (MyKategoreBean[])request.getAttribute("kategorilist");
}

String[] kategdate = null;
if((String[])request.getAttribute("kategdate") != null){
	kategdate = (String[])request.getAttribute("kategdate");
}

MyCommentBean[] latestcomment = (MyCommentBean[])request.getAttribute("latestcomment");	

if((MyCommentBean[])request.getAttribute("latestcomment") != null){
	latestcomment = (MyCommentBean[])request.getAttribute("latestcomment");
}

String id = (String)request.getAttribute("id");
int mypageid = (Integer)request.getAttribute("mypageid");
int level = (Integer)request.getAttribute("level");

String color;

if(level == 1){
	color = "#60b615";
}else{
	color = "#0f89d2";
}
	

if(Mem_Nick == null){ 
	out.println( "<script>" );
	out.println( "alert(\"로그인을 해주세요.\");" );
    out.println( "location.href=\"./index.jsp\";" );
	out.println( "</script>" );
%>
<%} %>
	<center>
			<table  width="158" height="100%" align="center" cellpadding="0" cellspacing="0" style="border: 1px solid <%=color%>">
		<tr height="9">
			<td colspan="3"></td>
		</tr>
		<tr height="34" valign="middle">
			<td width="19"></td>
			<td width="120" align="center"  bgcolor="<%=color%>">
				<b><%=Mem_Nick %>様<br/>ようこそ。</b>
			</td>
			<td width="19"></td>
		</tr>
		<tr height="9">
			<td colspan="3"></td>
		</tr>
		<tr height="23" align="center">
			<td width="19"></td>
			<td width="157">
				<a href=javascript:ControllerGo("<%=Mem_Nick%>","<%=session.getId()%>") id="changemassage" >
					<img id="massage_button">
				</a>
			</td>
			<td width="19"></td>
		</tr>
		
		<tr height="2"><td colspan="3"></td></tr>
		
		<tr height="25" align="center">
			<td width="19"></td>
			<td width="157">
				<a href="/KOMORIUTA/MemverRepAction.do?action_code=list&num=1" id="changeinfor">
					<img id="infor_button">
				</a>
			</td>
			<td width="19"></td>
		</tr>
		
		<tr height="2"><td colspan="3"></td></tr>
		
		<tr height="22" align="center">
			<td width="19"></td>
			<td>
				<a href=javascript:MypageCon('<%=Mem_Nick%>') id="changemypage">
					<img id="mypage_button">
				</a>
			</td>
			<td width="19"></td>
		</tr>
		
		<tr height="2"><td colspan="3"></td></tr>
		
		<tr height="22" align="center">
			<td width="19"></td>
			<td>
				<a href="/KOMORIUTA/MemberLogAction.do?action_code=logindelete" id="changelogout">
					<img id="logout_button">
				</a>
			</td>
			<td width="19"></td>
		</tr>

		<tr height="2"><td colspan="3"></td></tr>
		
		<tr height="22" align="center">
			<td width="19"></td>
			<td>
				<a href=javascript:entriWrite('<%=id%>',<%=mypageid%>) id="changewr">
					<img id="wr_button">
				</a>
			</td>
			<td width="19"></td>
		</tr>
		<%if(level == 2){ %>
		<tr height="2"><td colspan="3"></td></tr>
		
		<tr height="22" align="center">
			<td width="19"></td>
			<td>
				<% if(level == 2){ %><a href=javascript:manage('<%=id%>',<%=mypageid%>) id="changemyadmin">
					<img id="myadmin_button">
				</a><% } %>
			</td>
			<td width="19"></td>
		</tr>
		<%} %>
		<tr height="4"><td colspan="3"></td></tr>
	</table>
	
		
			<br />
			
			
			<!-- category -->
				
				
	<table width="158" height="100%" align="center" cellpadding="0" cellspacing="0" style="border: 1px solid <%=color%>">
		
		<tr height="9"><td colspan="3"></td></tr>
		
		<tr>
			<td width="10"></td>
			
			<td align="center" height="21" bgcolor="<%=color%>">
				カテゴリ
			</td>
			
			<td width="10"></td>
		</tr>
		
		<tr>
			<td width="19"></td>
			<td>
				<table width="100%" height="100%" align="center" cellpadding="0" cellspacing="0">
					<tr>
						<td align="center" height="21">
							<table align="center" cellpadding="0" cellspacing="0">
								<tr>
									<td onmouseover="this.style.backgroundColor='<%=color%>'" onmouseout="this.style.backgroundColor=''">
										<a href=javascript:wholeEntries("<%=id%>","<%=mypageid%>")>
										<img alt="" src="<%=request.getContextPath() %>/Main/image/Green_Left_Top_Arrow.png"> 全体
										</a>
									</td>
								</tr>
							<%if(kategorilist != null){
								for(int i = 0;i<kategorilist.length;i++){ %>
								<tr>
									<td onmouseover="this.style.backgroundColor='<%=color%>'" onmouseout="this.style.backgroundColor=''">
										<img alt="" src="<%=request.getContextPath() %>/Main/image/Green_Left_Top_Arrow.png">
										<%if(kategorilist[i].getKate_Count() != 0){ %>
											<a href=javascript:kategori("<%=id%>","<%=mypageid%>","<%=kategorilist[i].getKeta_Title() %>")>
										<%}%><%=kategorilist[i].getKeta_Title()%>(<%=kategorilist[i].getKate_Count()%>)</a>
									</td>
								</tr>
							<% }
							} %>
								<tr>
									<td onmouseover="this.style.backgroundColor='<%=color%>'" onmouseout="this.style.backgroundColor=''">
										<a href=javascript:kategori("<%=id%>","<%=mypageid%>","")>
										<img alt="" src="<%=request.getContextPath() %>/Main/image/Green_Left_Top_Arrow.png"> 分類無
										</a>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table><br/>
			</td>
			
			<td width="19"></td>
		</tr>
		
		<tr height="9"><td colspan="3"></td></tr>
	</table><br />
					
					
					
		<!-- 日付カテゴリ -->			
					
				<table width="158" height="100%" align="center" cellpadding="0" cellspacing="0" style="border: 1px solid <%=color%>">
					<tr height="9"><td colspan="3"></td></tr>
					
					<tr>
						<td width="10"></td>
						
						<td align="center" height="21" bgcolor="<%=color%>">
							日付カテゴリ<br/>
						</td>
						
						<td width="10"></td>
					</tr>
					
					<tr>
						<td colspan="3" align="center">
							<table >
							<%if(kategdate != null){
							for(int i = 0;i<kategdate.length;i++){ %><tr><td onmouseover="this.style.backgroundColor='<%=color%>'"
									onmouseout="this.style.backgroundColor=''">
								<a href=javascript:kategoriDate("<%=id%>","<%=mypageid%>","<%=kategdate[i]%>")><%=kategdate[i]%></a>
							<% }
							}%></td></tr></table>
						</td>
					</tr>
					
					<tr height="9"><td colspan="3"></td></tr>
				</table><br />
				
				
				
				<!-- 最近コメント -->		
				
				
				<table width="158" height="100%" align="center" cellpadding="0" cellspacing="0" style="border: 1px solid <%=color%>">
					<tr height="9"><td colspan="3"></td></tr>
					
					<tr>
						<td width="10"></td>
						
						<td align="center" height="21" bgcolor="<%=color%>" >
							最近コメント<br/>
						</td>
						
						<td width="10"></td>
					</tr>
					
					<tr>
						<td colspan="3" align="center">
							<table >
							<%if(latestcomment != null){
								for(int i = 0;i<latestcomment.length;i++){ %><tr><td onmouseover="this.style.backgroundColor='<%=color%>'"
									onmouseout="this.style.backgroundColor=''">
								<a href=javascript:page("<%=id%>","<%=latestcomment[i].getEntries_Number() %>","<%=latestcomment[i].getEntries_Id()%>")>
									<%=latestcomment[i].getCblog_Contents() %>
								</a>
							<% }
							}%></td></tr></table>
						</td>
					</tr>
					
					<tr height="9"><td colspan="3"></td></tr>
				</table><br />		
	</center>